package killer.member.model;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;

public class MemberDaoImpl implements MemberDao {
	private SqlSessionTemplate sqlSessionTemplate;	

	public MemberDaoImpl(SqlSessionTemplate sqlSessionTemplate) {
		super();
		this.sqlSessionTemplate = sqlSessionTemplate;
	}

	@Override
	public int insertMember(MemberVO paramMvo) throws Exception {
		System.out.println("MemberDao 회원 등록 메서드 실행..");
		return this.sqlSessionTemplate.insert("member.insertMember", paramMvo);
	}

	@Override
	public MemberVO selectMemberByIdAndPassword(MemberVO paramMvo)  throws Exception{
		System.out.println("MemberDao 아이디와 비밀번호를 이용하여 회원 정보를 찾는다.");
		return this.sqlSessionTemplate.selectOne("member.selectMemberByIdAndPassword",paramMvo);
	}

	@Override
	public int selectCheckPassword(MemberVO paramMvo) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateMember(MemberVO paramMvo) throws Exception {
		System.out.println("MemberDao 회원 정보를 수정합니다.");
		return this.sqlSessionTemplate.update("member.updateMember", paramMvo);
	}

	@Override
	public int deleteMember(String memberId) throws Exception {
		System.out.println("MemberDao 회원 탈퇴 합니다.");
		return this.sqlSessionTemplate.delete("member.deleteMember",memberId);
	}

	@Override
	public int selectCountById(String memberId) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public String selectIdBySsnAndName(MemberVO paramMvo) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String selectPasswordByIdAndSsn(MemberVO paramMvo) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List selectAllMemberList(int nowPage) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

}
